package com.dt76.smallloanbackenduser.remote.xiaohao;

import com.dt76.smallloanbackenduser.hystrix.xiaohao.BorrowOrderHystrix;
import com.dt76.smallloanbackenduser.pojo.xiaohao.BorrowOrder;
import com.dt76.smallloanbackenduser.pojo.xiaohao.BorrowOrderQuery;
import com.dt76.smallloanbackenduser.utils.Page;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name="smallloan-backend-service",fallback = BorrowOrderHystrix.class)
public interface BorrowOrderRemote {

    @RequestMapping("/xiaohao/BorrowOrder/qryAllOrder")
    Page qryAllOrder(@RequestParam("currentPageNo") Integer currentPageNo);

    @PostMapping(value = "/xiaohao/BorrowOrder/qryAllOrderByPage",consumes = "application/json")
    Page qryAllOrderByPage(@RequestParam("currentPageNo") Integer currentPageNo, @RequestBody BorrowOrderQuery borrowOrderQuery);

    @RequestMapping("/xiaohao/BorrowOrder/qryByID")
    BorrowOrder qryByID(@RequestParam("id") int id);

    @PostMapping(value = "/xiaohao/BorrowOrder/qryAllContract",consumes = "application/json")
    Page qryAllContract(@RequestParam("currentPageNo") Integer currentPageNo, @RequestBody BorrowOrderQuery borrowOrderQuery);

    @PostMapping(value = "/xiaohao/BorrowOrder/modifyBorrowOrderType",consumes = "application/json")
    int modifyBorrowOrderType(@RequestBody BorrowOrder borrowOrder);

}
